import { createStore, applyMiddleware, compose } from 'redux'
import { combineReducers } from 'redux-immutable'

import thunk from 'redux-thunk'

// 导入n个reducer
import loginReducer from './reducer/loginReducer'
import staffReducer from "./reducer/Staff"
import storeReducer from './reducer/storeReducer'
import goodsReducer from "./reducer/goodsReducer"
const reducer = combineReducers({
  login: loginReducer,
  staff:staffReducer,
  sr:storeReducer,
  goods:goodsReducer,
})

const composeEnhancers = (typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose
export default createStore(
  reducer,
  composeEnhancers(applyMiddleware(thunk))
)